def wus():
    global r,x,y,o,g,t,h,t,m,cuowu,cuo
    import time,random
    r = 0
    x = 0
    y = 0
    o = 0
    g = 6   #告诉程序一共听写几次
    m = 0
    t = {}
    h = {}
    t = {}
    cuowu = {}
    yi = {'old':'老的，年纪大的','young':'年轻的；岁数不大的','funny':'滑稽的；可笑的','kind':'体贴的；慈祥的；宽容的','strict':'要求严格的；严厉的','polite':'有礼貌的；客气的','hard-working':'工作努力的；辛勤的','helpful':'愿意帮忙的','clever':'聪明的；聪颖的','shy':'羞怯的；腼腆的；怕生的','know':'知道；了解','our':'我们的','Ms':'（用于女子的姓氏或姓名前，不指明婚否）女士','will':'（谈及将来）将要','sometimes':'有时；间或','robot':'机器人','him':'（用作宾语或表语）他','speak':'会说；会讲（某种语言）；用（某种语言）说话','finish':'完成；做好'}
    er = {'Monday':'星期一','Tuesday':'星期二','Wednesday':'星期三','Thursday':'星期四','Friday':'星期五','Saturday':'星期六','Sunday':'星期日','weekend':'周末','wash':'洗','wash my clothes':'洗我的衣服','watch TV':'看电视','do':'做；干','do homework':'做作业','read':'看；读','read books':'看书','play football':'踢足球','cooking':'烹饪；烹调','often':'时常；常常','park':'公园','tired':'疲倦的','sport':'体育运动','play sports':'做体育运动','should':'（常用于纠正别人）应该，应当','every':'每一个，每个','day':'一天；一日','schedule':'工作计划；日程安排'}
    san = {'sandwich':'三明治','salad':'蔬菜沙拉；混合沙拉','hamburger':'汉堡包','ice cream':'冰淇淋','tea':'茶；茶水','fresh':'新鲜的','healthy':'健康的','delicious':'美味的；可口的','hot':'辣的；辛辣的','sweet':'含糖的；甜的','drink':'喝；饮','thirsty':'渴的；口渴的','favourite':'特别喜爱的','food':'食物','Dear':'(用于信函抬头的名字或头衔前）亲爱的','onion':'洋葱；葱头'}
    si = {'sing':'唱；唱歌','song':'歌曲','sing English songs':'唱英文歌曲','play the pipa':'弹琵琶','kung fu':'功夫；武术','do kung fu':'练武术','dance':'跳舞','draw':'画','cartoon':'漫画','draw cartoons':'画漫画','cook':'烹调；烹饪','swim':'游泳','play basketball':'打篮球','ping-pong':'乒乓球','play ping-pong':'打乒乓球','speak English':'说英语',"we'll":'we will','party':'聚会；派对','next':'下一个的；紧接着的；接下来的','wonderful':'极好的；了不起的','learn':'学；学习；学会','any':'任何的；任一的','problem':'问题','no problem':'没问题','want':'要；想要','send':'邮寄；发送','email':'电子邮件','at':'（后面接邮件地址）'}
    wu = {'clock':'时钟；钟','plant':'植物','bottle':'瓶子','water bottle':'水瓶','bike':'自行车；脚踏车','photo':'照片；相片','front':'正面','in front of':'在.......前面','between':'在........中间','above':'在（或向）.......上面','beside':'在旁边（附近）','behind':'在（或向）.......后面','there':'(表示存在或发生）','grandparent':'祖父；祖母；外祖父：外祖母','their':'他们的；她们的；它们的（宾格）','house':'房屋；房子；住宅','lot':'大量；许多（没有of）','lots of':'大量；许多','flower':'花；花朵','move':'搬家','dirty':'肮脏的','everywhere':'处处；到处','mouse':'老鼠','live':'住；居住','nature':'自然界；大自然'}
    liu = {'forest':'森林；林区','river':'河；江','lake':'湖；湖泊','mountain':'高山；山岳','hill':'山丘；小山','tree':'树；树木；乔木','bridge':'桥','building':'建筑物；房子；楼房','village':'村庄；村镇','house':'房屋；房子；住宅','boating':'划船','go boating':'去划船',"aren't":'are not','rabbit':'兔；野兔','high':'高的'}
    e = {0:yi,1:er,2:san,3:si,4:wu,5:liu}
    def q(v):
        global r,x,y,o,g,t,h,t,m,cuowu
        dict_key_ls = list(v.keys())
        random.shuffle(dict_key_ls)
        new_dic = {}
        for key in dict_key_ls:
            new_dic[key] = v.get(key)
        v = new_dic
        for i in v:
            cuowu = v[i]
            if 'we will' in v or 'are not' in v:
                q = input(cuowu + "：")
            else:
                q = input(cuowu + '：')
            w = i
            if q == w:
                print('对喽！')
                r += 1
            else:
                print('错啦错啦！')
                t[cuowu] = w
                x += 1
        print('结束！')
        print('一共对',r,'道，错',x,'道')
        if x != 0:
            print('\n不扎实',x,'道！巩固错题：')
            for i in t:
                q = input(i + '：')
                w = t[i]
                if q == w:
                    print('对喽！')
                    y += 1
                else:
                    print('错啦错啦！')
                    o += 1
                    m += 1
                    h[i] = w
            print('结束！')
            print('一共对',y,'道，错',o,'道')
        x = 0
        r = 0
        c = 0
        y = 0
        o = 0
        t = {}
    for l in range(g):
        print('\n第',l+1,'单元！\n')
        v = e[l]
        q(v)
    if m != 0:
        html = open('cuowu.txt','r')
        php = html.read()
        html.close()
        go = open('cuowu.txt','a')
        print('\n错题答案：共',m,'个二错单词\n')
        for i in h:
            d = h[i]
            print(i , d)
            if i not in php or d not in php:
                go.write("'")
                go.write(i)
                go.write("'")
                go.write(':')
                go.write("'")
                go.write(d)
                go.write("'")
                go.write(',\n')
        go.close()
    time.sleep(10)